//<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=6Gn6G9sirmwEimvAZ5HxAt4r4mXN4uWw"></script>
//需引入上述js
var getLocation = function(){
	var geolocation = new BMap.Geolocation();
    geolocation.getCurrentPosition(function(r){
        if(this.getStatus() == BMAP_STATUS_SUCCESS){
            console.log(r.address.city);
            return r.address.city;
        }
    });
};